package labox.innovation.loginserver.gameserverpackets;

import labox.innovation.loginserver.GameServerTable;
import labox.innovation.loginserver.GameServerTable.GameServerInfo;

public class PlayerCountsRequest extends ClientBasePacket{
	public PlayerCountsRequest(byte[] decrypt) {
		super(decrypt);
		int gameServerID = readUnByte();  //-- 获取游戏服务器ID
		int playerCounts = readInt();  //-- 获取游戏服务器上当前玩家数
		int maxPlayers = readInt();  //-- 获取游戏服务器上玩家最大上限设置

		GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(gameServerID);
		if (gsi != null) {
			gsi.setPlayCount(playerCounts);
			gsi.setMaxPlayers(maxPlayers);
		}
	}
}
